package com.drama.api.sys.download.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.drama.api.base.ApiIndex;
import com.drama.api.base.R;
import com.drama.api.base.RestPage;
import com.drama.api.sys.download.domain.vo.DownloadLogSearchVO;
import com.drama.api.sys.download.domain.vo.DownloadLogVO;
import com.drama.api.sys.download.service.IVideoDownloadLogService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api( tags = ApiIndex.DownloadLogController)
@RequestMapping(value = "/api/sys/download")
@RestController
@SaCheckLogin
public class DownloadLogController {
    @Autowired
    private IVideoDownloadLogService service;


    @ApiOperation(value = "查询下载日志列表")
    @GetMapping(value = "/list")
    public R<RestPage<List<DownloadLogVO>>> list(
            @ApiParam(value = "查询参数") @ModelAttribute DownloadLogSearchVO searchVO) {
        List<DownloadLogVO> list = service.getList(searchVO);
        RestPage restPage = new RestPage(new PageInfo(list), list);
        return new R(restPage);
    }


}
